
while !isOnGem {
    moveForward()
    
    if isOnClosedSwitch {
        toggleSwitch()
        
    }
    
    if isBlocked {
        turnRight()
        
    }
    
}
collectGem()
